﻿<?xml version="1.0" encoding="utf-8"?>

<xsd:schema
    targetNamespace="http://metalx.org/i386/Functions/Stream"
    elementFormDefault="qualified"
    xmlns="http://metalx.org/i386/Functions/Stream"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="ReadByte">
		<xsd:annotation>
			<xsd:documentation>
				Reads a byte from a memory stream.

				Input:
				SI=Address

				Output:
				AL=Value
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteByte">
		<xsd:annotation>
			<xsd:documentation>
				Writes a byte to a memory stream.

				Input:
				DI=Address
				AL=Value
				
				Modifies: DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadShort">
		<xsd:annotation>
			<xsd:documentation>
				Reads a short integer from a memory stream.

				Input:
				SI=Address

				Output:
				AX=Value
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteShort">
		<xsd:annotation>
			<xsd:documentation>
				Writes a short integer to a memory stream.

				Input:
				DI=Address
				AX=Value
				
				Modifies: DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:element name="ReadShortReverse">
		<xsd:annotation>
			<xsd:documentation>
				Reads a short integer from a memory stream in reverse byte order.

				Input:
				SI=Address

				Output:
				AX=Value
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteShortReverse">
		<xsd:annotation>
			<xsd:documentation>
				Writes a short integer to a memory stream in reverse byte order.

				Input:
				DI=Address
				AX=Value
				
				Modifies: DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadInteger">
		<xsd:annotation>
			<xsd:documentation>
				Reads an integer from a memory stream.

				Input:
				SI=Address

				Output:
				AX=Value
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteInteger">
		<xsd:annotation>
			<xsd:documentation>
				Writes an integer to a memory stream.

				Input:
				DI=Address
				AX=Value
				
				Modifies: DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadIntegerReverse">
		<xsd:annotation>
			<xsd:documentation>
				Reads an integer from a memory stream in reverse byte order.

				Input:
				SI=Address

				Output:
				AX=Value
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteIntegerReverse">
		<xsd:annotation>
			<xsd:documentation>
				Writes an integer to a memory stream in reverse byte order.

				Input:
				DI=Address
				AX=Value
				
				Modifies: DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadString32">
		<xsd:annotation>
			<xsd:documentation>
				Reads a 32 bit length-prefixed string from a memory stream.

				Input:
				SI=Address

				Output:
				DI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteString32">
		<xsd:annotation>
			<xsd:documentation>
				Writes a 32 bit length-prefixed string to a memory stream.

				Input:
				DI=Address
				SI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadString16">
		<xsd:annotation>
			<xsd:documentation>
				Reads a 16 bit length-prefixed string from a memory stream.

				Input:
				SI=Address

				Output:
				DI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteString16">
		<xsd:annotation>
			<xsd:documentation>
				Writes a 16 bit length-prefixed string to a memory stream.

				Input:
				DI=Address
				SI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadString8">
		<xsd:annotation>
			<xsd:documentation>
				Reads an 8 bit length-prefixed string from a memory stream.

				Input:
				SI=Address

				Output:
				DI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteString8">
		<xsd:annotation>
			<xsd:documentation>
				Writes an 8 bit length-prefixed string to a memory stream.

				Input:
				DI=Address
				SI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="ReadCharacters">
		<xsd:annotation>
			<xsd:documentation>
				Reads a fixed-length string from a memory stream.

				Input:
				SI=Address

				Output:
				DI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="length" type="xsd:integer"/>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="WriteCharacters">
		<xsd:annotation>
			<xsd:documentation>
				Writes a fixed-length string to a memory stream.

				Input:
				SI=String
				DI=Address
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="length" type="xsd:integer"/>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="ReadString">
		<xsd:annotation>
			<xsd:documentation>
				Reads a null-terminated string from a memory stream.

				Input:
				SI=Address

				Output:
				DI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name="WriteString">
		<xsd:annotation>
			<xsd:documentation>
				Writes a null-terminated string to a memory stream.

				Input:
				DI=Address
				SI=String
				
				Modifies: SI DI
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

</xsd:schema>
